<?php
use eqphp\system, eqphp\session, eqphp\input, eqphp\query, eqphp\debug, server\smarty3;

define('URL_STATIC', '/file/static/');
define('URL_UPLOAD', '/file/upload/');

define('PATH_DATA', PATH_ROOT . 'data/');
define('DATA_LANG', PATH_DATA . 'lang/');
define('DATA_DICT', PATH_DATA . 'dict/');
define('DATA_BACKUP', PATH_DATA . 'backup/');
define('DATA_CONFIG', PATH_DATA . 'config/');

define('PATH_TEMP', PATH_ROOT . 'temp/');
define('PATH_CACHE', PATH_TEMP . 'cache/');
define('PATH_LOG', PATH_TEMP . 'log/');
define('LOG_TOPIC', PATH_LOG . 'topic/');

define('PATH_FILE', PATH_ROOT . 'file/');
define('PATH_UPLOAD', PATH_FILE . 'upload/');
define('FILE_PICTURE', PATH_UPLOAD . 'picture/');
define('FILE_AVATAR', FILE_PICTURE . 'avatar/');

define('PATH_VENDOR', PATH_ROOT . 'vendor/');
define('PATH_VIEW', PATH_ROOT . 'view/');
define('PATH_SCRIPT', PATH_ROOT . 'server/script/');

//解析分组配置文件
function config($name, $is_module = false){
    return system::config($name, $is_module);
}

//会话
function session($key = null, $value = false){
    return session::merge($key, $value);
}

//对象工厂
function with(){
    return call_user_func_array('eqphp\util::with', func_get_args());
}

//获取url参数
function url($lie, $type = 0){
    return input::url($lie, $type);
}

//表单值接收处理
function post($name, $mode = 'post'){
    return input::post($name, $mode);
}

//实例化数据表模型
function query($table, $db = 0){
    return new query($table, $db);
}

//调试
function out($param = 'ok', $mode = 1, $is_exit = true){
    debug::out($param, $mode, $is_exit);
}